package com.resys.entity.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.math.BigDecimal;
import java.util.Date;
import com.resys.entity.enums.DateTimePatternEnum;
import com.resys.utils.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;


/**
 * 
 */
public class Reservationorder implements Serializable {


	/**
	 * 
	 */
	private Integer orderId;

	/**
	 * 
	 */
	private String customerId;

	/**
	 * 
	 */
	private Integer roomId;

	/**
	 * 
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime;

	/**
	 * 
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endTime;

	/**
	 * 
	 */
	private Integer participantsNum;

	/**
	 * 
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createdAt;

	/**
	 * 0=锁单, 1=已支付, 2=取消,3=完成
	 */
	private Integer status;

	/**
	 * 
	 */
	private BigDecimal totalPrice;

	/**
	 * 
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date paymentTime;

	/**
	 * 锁单截止时间，代码层面可以下单时间+30分钟设计
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date lockedUntil;


	public void setOrderId(Integer orderId){
		this.orderId = orderId;
	}

	public Integer getOrderId(){
		return this.orderId;
	}

	public void setCustomerId(String customerId){
		this.customerId = customerId;
	}

	public String getCustomerId(){
		return this.customerId;
	}

	public void setRoomId(Integer roomId){
		this.roomId = roomId;
	}

	public Integer getRoomId(){
		return this.roomId;
	}

	public void setStartTime(Date startTime){
		this.startTime = startTime;
	}

	public Date getStartTime(){
		return this.startTime;
	}

	public void setEndTime(Date endTime){
		this.endTime = endTime;
	}

	public Date getEndTime(){
		return this.endTime;
	}

	public void setParticipantsNum(Integer participantsNum){
		this.participantsNum = participantsNum;
	}

	public Integer getParticipantsNum(){
		return this.participantsNum;
	}

	public void setCreatedAt(Date createdAt){
		this.createdAt = createdAt;
	}

	public Date getCreatedAt(){
		return this.createdAt;
	}

	public void setStatus(Integer status){
		this.status = status;
	}

	public Integer getStatus(){
		return this.status;
	}

	public void setTotalPrice(BigDecimal totalPrice){
		this.totalPrice = totalPrice;
	}

	public BigDecimal getTotalPrice(){
		return this.totalPrice;
	}

	public void setPaymentTime(Date paymentTime){
		this.paymentTime = paymentTime;
	}

	public Date getPaymentTime(){
		return this.paymentTime;
	}

	public void setLockedUntil(Date lockedUntil){
		this.lockedUntil = lockedUntil;
	}

	public Date getLockedUntil(){
		return this.lockedUntil;
	}

	@Override
	public String toString (){
		return "orderId:"+(orderId == null ? "空" : orderId)+"，customerId:"+(customerId == null ? "空" : customerId)+"，roomId:"+(roomId == null ? "空" : roomId)+"，startTime:"+(startTime == null ? "空" : DateUtil.format(startTime, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+"，endTime:"+(endTime == null ? "空" : DateUtil.format(endTime, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+"，participantsNum:"+(participantsNum == null ? "空" : participantsNum)+"，createdAt:"+(createdAt == null ? "空" : DateUtil.format(createdAt, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+"，0=locked, 1=confirmed, 2=cancelled:"+(status == null ? "空" : status)+"，totalPrice:"+(totalPrice == null ? "空" : totalPrice)+"，paymentTime:"+(paymentTime == null ? "空" : DateUtil.format(paymentTime, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+"，锁单截止时间，代码层面可以下单时间+30分钟设计:"+(lockedUntil == null ? "空" : DateUtil.format(lockedUntil, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()));
	}
}
